package com.company.behavioral.mediator_pattern.colleague;

import com.company.behavioral.mediator_pattern.mediator.Mediator;

/**
 * 抽象组件
 * @ClassName Component
 * @Author tiezheng.han
 * @Date 2020/9/4 17:01
 **/
public abstract class Component {

    protected Mediator mediator;

    public void setMediator(Mediator mediator) {
        this.mediator = mediator;
    }

    /**
     * 转发调用
     */
    public void changed(){
        mediator.componentChanged(this);
    }

    public abstract void update();
}
